<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="admin/common/html/tableHead :: head(~{::title},~{::link},~{::style})">

    <title th:text=${title}></title>
    <!-- 这儿引用单独的css link -->
    <!-- Ladda for Bootstrap 3按钮加载进度插件 -->
    <link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
    <!-- bootstrap-table表单样式 -->
    <link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
    <!-- 用户界面自定义css -->
    <link th:href="@{/static/admin/user/css/user-add.css}" rel="stylesheet"/>
    <style type="text/css"></style>
</head>

<style>
    .tips {
        text-align: center
    }
    .imgCss{width:100px;height:100px;margin-left: 10px;margin-right: 10px;}
</style>
<body>
<div class="well">
    <form class="form-horizontal" role="form">

        <div class="form-group" th:each="field: ${FormInstanceFieldValueList}">
            <div th:if="${field.fieldType=='textarea'||field.fieldType=='text'}">
                <label class="col-sm-2 control-label" th:text="${field.fieldLabel}"></label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" th:value="${field.value}">
                </div>
            </div>
            <div th:if="${field.fieldType=='file'&&#strings.indexOf(field.fieldName,'img')==0}">
                <label class="col-sm-2 control-label" th:text="${field.fieldLabel}"></label>
                <div class="col-sm-10" th:id="${field.fieldName}">
                    <img src="https://oss.liuyanzhao.com/assets/img/taobaoshow.jpg" class="imgCss">
                </div>
            </div>
        </div>
    </form>
</div>
<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">

</div>
<!-- bootstarp 表格 -->
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}"
        type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"
        type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>
u

<!-- 弹窗 -->
<script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>
<!-- jqueryForm序列化 -->
<script th:src="@{/static/js/jqueryFormSerializeJson.js}" type="text/javascript"></script>
<!--引入自定义的下拉选框-->
<script th:src="@{/static/js/self_select.js}" type="text/javascript"></script>
<script th:inline="javascript" type="text/javascript">

    /*var formId = [[${formKey}]];
    var formInstanceId = [[${formInstanceId}]];*/

    $(function () {
        /*<![CDATA[*/
        /*[# th:each="field : ${FormInstanceFieldValueList}"]*/
            /*[# th:if="${field.fieldType=='file'&&#strings.indexOf(field.fieldName,'img')==0}"]*/
                console.info(/*[[${field.fieldName}]]*/);
                var ids=[[${field.value}]];
                var idsArr=ids.split(',');
                var html='';
                for(var i=0;i<idsArr.length;i++){
                    if(idsArr[i]!=null&&idsArr[i]!=''){
                        html+='<img src="/TFileController/tFile/preFile/'+idsArr[i]+'" class="imgCss">';
                        //<img src="https://oss.liuyanzhao.com/assets/img/taobaoshow.jpg" class="imgCss">
                    }
                }
                $("#"+[[${field.fieldName}]]).html(html);
                console.info(ids);
            /*[/]*/
        /*[/]*/

        /*]]>*/


    })
</script>


</body>


</html>
